export default function ReturnTablist() {
  let Tablist: any = JSON.parse(localStorage.getItem('auth') as string);
  let TabListNew: any = [];
  Tablist.map((item: any) => {
    if (item.authority === 'ROLE_成员') {
      TabListNew.push({
        tab: localStorage.getItem('account') + '老师视角',
        key: '个人视角',
      });
    }
    if (item.authority === 'ROLE_子方向负责人') {
      TabListNew.push({
        tab:
          JSON.parse(localStorage.getItem('personInfo') as string)[
            'ROLE_子方向负责人'
          ].name + '子方向视角',
        key: '子方向视角',
      });
    }
    if (item.authority === 'ROLE_方向负责人') {
      TabListNew.push({
        tab:
          JSON.parse(localStorage.getItem('personInfo') as string)[
            'ROLE_方向负责人'
          ].name + '方向视角',
        key: '方向视角',
      });
    }
    if (item.authority === 'ROLE_管理员') {
      TabListNew.push({
        tab: '实验室全部成果',
        key: '管理员视角',
      });
    }
  });
  return TabListNew;
}
